	

function bindPptFullscreenGesture(){
	$("#pptImgView").bind("gestureend", function(){
		if(event.scale > 1.2){
			enterFullscreen($(this));
			$(this).css("-webkit-overflow-scrolling", "touch");
		}else if(event.scale < 0.8){
			existFullscreen($(this));
		}
	});
}

function bindVideoFullscreenGesture(){
	$("#videoWrap").bind("gestureend", function(){
		if(event.scale > 1.2){
			enterFullscreen($(this));
			$("#videoWrap").css("position","");
			videoStartBtn();
			preventTouch($(this));
		}else if(event.scale < 0.8){
			existFullscreen($(this));
			if($("#videoView").is(".videoMove"))$("#videoWrap").css("position","static");
			videoStartBtn();
			releaseTouch($(this));
		}
	});
}

function bindVideoTouchwipe(){
	$("#videoView").touchwipe({
		preventDefaultEvents:false,
        wipeLeft: function() {
        	if(!mainViewIsVideo() && isLandscape()){videoToMainView();}
        },
        wipeRight: function() {
        	if(mainViewIsVideo() && isLandscape()){docToMainView();}
        },
        wipeUp: function(){//插件中的wipeUp和wipDown好像写反了
        	info("[ipad-live][touch] event: wipeUp");
        	if(!mainViewIsVideo() && !isLandscape() && !$("#videoWrap").hasClass("fullScreen")){videoToMainView();}
        },
        wipeDown: function(){
        	info("[ipad-live][touch] event: wipeDown");
        	if(mainViewIsVideo() && !isLandscape() && !$("#videoWrap").hasClass("fullScreen")){docToMainView();}
        }
    });
}

function bindPptTouchwipe(){
	$("#pptView").touchwipe({
		preventDefaultEvents:false,
        wipeLeft: function() {
        	if(!mainViewIsDoc() && isLandscape()){docToMainView();}
        },
        wipeRight: function() {
        	if(mainViewIsDoc() && isLandscape()){videoToMainView();}
        },
        wipeUp: function(){
        	if(!mainViewIsDoc() && !isLandscape() && !$("#pptImgView").hasClass("fullScreen")){
        		docToMainView();
        	}
        },
        wipeDown: function(){
        	if(mainViewIsDoc() && !isLandscape() && !$("#pptImgView").hasClass("fullScreen")){videoToMainView();}
        }
    });
}

function preventTouch($elem){
	$elem.bind("touchstart", preventDefault);
}

function releaseTouch($elem){
	$elem.unbind("touchstart", preventDefault);
}

function preventDefault(event){
	event.preventDefault();
}

	
